package cn.itcast.bookmanager.jframe;

import cn.itcast.bookmanager.dao.UserDao;
import cn.itcast.bookmanager.model.User;
import cn.itcast.bookmanager.util.JFrameUtils;
import cn.itcast.bookmanager.util.JdbcUtils;
import cn.itcast.bookmanager.util.ToolUtils;
import com.mysql.jdbc.Connection;
import org.jb2011.lnf.beautyeye.BeautyEyeLNFHelper;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class LanguageChooseFrame extends JFrame{
    private JFrame jf;

    public LanguageChooseFrame() {
        jf = new JFrame("Language Choose");
        jf.getContentPane().setFont(new Font("Arial",Font.BOLD,12));
        jf.setBounds(600,300,600,200);
        jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        jf.getContentPane().setLayout(null);

        JButton button_en = new JButton("English");
        button_en.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                jf.dispose();
                new LoginFrame_EN();
            }
        });
        button_en.setBounds(400, 40, 100, 30);
        //坐标要改
        jf.getContentPane().add(button_en);
        jf.setBackground(Color.green);
        jf.setAlwaysOnTop(true);
        //切换语言

        JButton button_cn = new JButton("中文");
        button_cn.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                jf.dispose();
                new LoginFrame();
            }
        });
        button_cn.setBounds(100, 40, 100, 30);
        //坐标要改
        jf.getContentPane().add(button_cn);
        //切换语言

        JLabel lblNewLabel = new JLabel("");
        lblNewLabel.setIcon(new ImageIcon(LanguageChooseFrame.class.getResource("/tupian/adBG3_1.png")));
        lblNewLabel.setBounds(0,0,600,200);
        jf.getContentPane().add(lblNewLabel);

        jf.setVisible(true);
        jf.setResizable(true);
    }

    public static void main(String[] args) {
        try {
            BeautyEyeLNFHelper.frameBorderStyle = BeautyEyeLNFHelper.FrameBorderStyle.generalNoTranslucencyShadow;
            org.jb2011.lnf.beautyeye.BeautyEyeLNFHelper.launchBeautyEyeLNF();
        } catch (Exception e) {
            e.printStackTrace();
        }
        new LanguageChooseFrame();
    }

}
